package com.twu.biblioteca;

public class Book {
    private int id;
    private String name;
    private String author;
    private String publisher;
    private boolean isAvailable = true;

    public Book(int bookId, String bookName, String bookAuthor, String bookPublisher ) {
        id = bookId;
        name = bookName;
        author = bookAuthor;
        publisher = bookPublisher;
    }

    public void display() {
        System.out.println("Book id : " + id + " Name : " + name + " Author : " + author +
                " Publisher : " + publisher + " Availability : " + isAvailable);
    }

    public boolean setAvailabilityForBorrow () {
        if(isAvailable == true ) {
            isAvailable = false;
            System.out.println("Thank you! Enjoy the book.");
            return true;
        }
        System.out.println("Sorry we don't have that book yet");
        return false;
    }

    public boolean setAvailabilityForReturn () {
        if(isAvailable == false) {
            isAvailable = true;
            System.out.println("Thank you!");
            return true;
        }
        return false;
    }

}
